<include file="Public:header" />

<script>
//移动内容 到分类
	function moveSupplier(e){
		var ids=new Array();
		$('.sall').each(function(index, element) {
            if($(this).prop('checked')== true){
				ids.push($(this).val());
			}
        });
		if(ids.length>0){
			if(confirm('您确定要移动选中记录吗？')){
			    window.location.href="{:U('moveSupplier')}?id="+ids.toString()+"&supplier_id="+e.value;
			}else{
				return false;
			}
		}else{
			error('请选择要移动的记录');
		}
	}
	
	
		function setproduct(){
		var ids=new Array();
		$('.sall').each(function(index, element) {
            if($(this).prop('checked')== true){
				ids.push($(this).val());
			}
        });
		if(ids.length>0){
			if(confirm('您确定要上架选中商品吗？')){
			    window.location.href="{:U('setProduct')}?id="+ids.toString();
			}else{
				return false;
			}
		}else{
			error('请选择要上架的商品');
		}
	}
</script>

<div class="container main"> <include file="Public:left" />
  <div class="w790">

    <div class="table_">
      <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
        <thead>
          <tr>
            <td align="center">ID</td>
            <td align="center">名称</td> 
            <td align="center">图片</td>
            <td align="center">价格</td>
            <td align="center">操作</td>
          </tr>
        </thead>
        <volist name="list" id="vo">
          <tr class="data_list">
            <td align="center"><input type="checkbox" name="id" id="id" class="sall" value="{$vo.id}" />
             </td>
            <td> <span class="ajaxText" tablename="Product" field="title" id="{$vo.id}" val="{$vo.title}">{$vo.title}</span></td>
            <td><img src="{:getThumbPath($vo['img_url'])}" width="50" /></td>
            <td align="center">
            <volist name="vo['price']" id="pvo">
          <eq name="pvo['num']" value="0">
              <p>无限时：{$pvo.price}元<br/></p>
              <else/>
              <p>{$pvo.num}个月：{$pvo.price}元/月<br /></p>
              
          </eq>
          

      </volist>
            </td>
            
            <td align="center">
            <notempty name="vo['product_id']">
            <a href="{:U('Product/edit', array('id' => $vo['product_id']))}" target="_blank">编辑</a>
            <else/>
            <a href="{:U('setProduct',array('id'=>$vo['id']))}" class="btn btn-success"><i class="glyphicon glyphicon-download-alt"></i> 上架</a>
            </notempty>
            
            </td>
          </tr>
        </volist>
      </table>
     <div class="pages">
        <div class="controlList fl"><a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="sall();"><i class="glyphicon glyphicon-check"></i> 全选/反选</a> <a href="javascript:void(0);" class="btn btn-primary btn-sm" onclick="rall();"><i class="glyphicon glyphicon-unchecked"></i> 全不选</a> <a class="btn btn-success btn-sm" href="javascript:void(0);" onclick="setproduct();"><i class="glyphicon glyphicon-download-alt"></i> 上架</a>

        
       
        
        
        
        </div>
          <form class="fr" style="display:inline;" id="pagesize" action="" method="get">
         <label class="form-inline" > 每页
          <select name="pagesize" onchange="document.getElementById('pagesize').submit();" class="form-control">
            <option 
            <eq name="pagesize" value="10">selected="selected"</eq>
             value="10">10
            </option>
            <option 
            <eq name="pagesize" value="20">selected="selected"</eq>
             value="20">20
            </option>
            <option 
            <eq name="pagesize" value="30">selected="selected"</eq>
             value="30">30
            </option>
            <option 
            <eq name="pagesize" value="50">selected="selected"</eq>
             value="50">50
            </option>
            <option 
            <eq name="pagesize" value="100">selected="selected"</eq>
             value="100">100
            </option>
            <option 
            <eq name="pagesize" value="500">selected="selected"</eq>
             value="500">500
            </option>
          </select>
          条</label>
          <input type="hidden" name="category_id" value="{$category_id}" />
          <input type="hidden" name="keywords" value="{$keywords}" />
        </form>
        <div class="fr">{$pages}</div>
      
    </div>
  </div>
  <div class="clear"></div>
</div>
<include file="Public:footer" />